package com.haoshuang.zhouzhoubang.ui.page.home.settings.skill.record

import com.haoshuang.zhouzhoubang.model.api.ApiRepo
import com.haoshuang.zhouzhoubang.model.bean.Jn2Bean
import com.mufeng.libs.base.BaseViewModel
import com.mufeng.libs.net.ResponseBean
import com.mufeng.libs.net.netRequest
import com.mufeng.libs.state.StateData
import com.mufeng.libs.state.StatefulMutableLiveData

class SkillRecordViewModel : BaseViewModel() {

    /**
     * 门店申请的技能记录
     */
    val getTeamCategoryListData = StatefulMutableLiveData<ResponseBean<MutableList<Jn2Bean>>>()
    fun getTeamCategoryList() = netRequest {
        start { getTeamCategoryListData.value = StateData.Loading }
        request { ApiRepo.getTeamCategoryList()  }
        success { getTeamCategoryListData.value = StateData.Success(it) }
        error { code, msg ->
            getTeamCategoryListData.value = StateData.Error(code, msg)
        }
    }

}